home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_pointer2.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  885 b   |  50 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_POINTER2
  5.  
  6. creation make
  7.    
  8. feature 
  9.    
  10.    make is
  11.       local
  12.      ap: ARRAY[POINTER];
  13.      aa: ARRAY[ANY];
  14.      p: POINTER;
  15.      pr: POINTER_REF;
  16.       do
  17.      !!ap.make(1,2);
  18.      is_true(ap.item(1) = p);
  19.      is_true(ap.count = 2);
  20.  
  21.      is_true(equal(ap,<<p,p>>));
  22.  
  23.      aa := ap;
  24.      is_true(aa /= Void);
  25.      ap ?= aa;
  26.      is_true(ap /= Void);
  27.  
  28.      pr := p;
  29.      is_true(pr /= Void);
  30.      is_true(pr.item = p);
  31.      pr := ap.item(1);
  32.      is_true(pr.item.is_void);
  33.       end;
  34.    
  35.    is_true(b: BOOLEAN) is
  36.       do
  37.      cpt := cpt + 1;
  38.      if not b then
  39.         std_output.put_string("TEST_POINTER2: ERROR Test # ");
  40.         std_output.put_integer(cpt);
  41.         std_output.put_string("%N");
  42.      else
  43.         -- std_output.put_string("Yes%N");
  44.      end;
  45.       end;
  46.    
  47.    cpt: INTEGER;
  48.    
  49. end -- TEST_POINTER2
  50.